#!/bin/sh
STATUS=$(acpi | awk -F ',' {'print $1'} | awk {'print $3'})
TIME=$(acpi | awk {'print $5'})
if [ "$STATUS" = "Discharging" ]; then
    CNSTATUS="未插入充电器"
    TIME="剩余 $TIME"
elif [ "$STATUS" = "Charging" ]; then
    CNSTATUS="充电中..."
    TIME="$TIME 充满"
else
    CNSTATUS="已插入充电器，未充电"
    TIME=""
fi

case "$1" in
    1) dunstify "$CNSTATUS" "$TIME" ;;
esac
